﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace Budget
{
    class ListViewEx : ListView
    {
        private const int WM_LBUTTONDBLCLK = 0x203;

        protected override void WndProc(ref Message m)
        {
            if (m.Msg == WM_LBUTTONDBLCLK)
            {
                Int16 x = (Int16)m.LParam;
                Int16 y = (Int16)((int)m.LParam >> 16);

                MouseEventArgs e =
                    new MouseEventArgs(MouseButtons.Left, 2, x, y, 0);

                this.OnMouseDoubleClick(e);
            }
            base.WndProc(ref m);
        }
    }
}
